﻿<UserControl 
    x:Name="This"
    x:Class="HeritageAcademy.Library.Controls.Registration"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:Controls="clr-namespace:HeritageAcademy.Library.Controls" 
    xmlns:ViewModel="clr-namespace:HeritageAcademy.Models.ViewModels;assembly=HeritageAcademy.Models" 
    Visibility="Visible">
    
    <UserControl.Resources>
    	<Storyboard x:Key="Open">
    		<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FlyoutGrid" Storyboard.TargetProperty="(UIElement.Opacity)">
    			<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
    			<SplineDoubleKeyFrame KeyTime="00:00:00.07" Value="1"/>
    		</DoubleAnimationUsingKeyFrames>
    		<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FlyoutGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
    			<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.8"/>
    			<SplineDoubleKeyFrame KeyTime="00:00:00.20" Value="1" KeySpline="0,1,0.51,1"/>
    		</DoubleAnimationUsingKeyFrames>
    		<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FlyoutGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
    			<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.8"/>
    			<SplineDoubleKeyFrame KeyTime="00:00:00.20" Value="1" KeySpline="0,1,0.51,1"/>
    		</DoubleAnimationUsingKeyFrames>
    	</Storyboard>
    	<Storyboard x:Key="Close">
    		<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FlyoutGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
    			<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
    			<SplineDoubleKeyFrame KeySpline="0.49,0,1,0" KeyTime="00:00:00.2500000" Value="0.7"/>
    		</DoubleAnimationUsingKeyFrames>
    		<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FlyoutGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
    			<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
    			<SplineDoubleKeyFrame KeySpline="0.49,0,1,0" KeyTime="00:00:00.2500000" Value="0.7"/>
    		</DoubleAnimationUsingKeyFrames>
    		<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FlyoutGrid" Storyboard.TargetProperty="(UIElement.Opacity)">
    			<SplineDoubleKeyFrame KeyTime="00:00:00.1500000" Value="1"/>
    			<SplineDoubleKeyFrame KeyTime="00:00:00.2500000" Value="0"/>
    		</DoubleAnimationUsingKeyFrames>
    	</Storyboard>
    </UserControl.Resources>

    <Canvas Width="0" Height="0">
        <Rectangle Width="20000" Height="20000" Fill="#0000" Canvas.Top="-9976" Canvas.Left="-9993" MouseLeftButtonDown="Rectangle_MouseLeftButtonDown" RenderTransformOrigin="0.5,0.499" />

        <Grid x:Name="FlyoutGrid" RenderTransformOrigin="1,1" SnapsToDevicePixels="True" Opacity="1" Canvas.Bottom="0" Canvas.Right="0" Canvas.Left="-304" Canvas.Top="-513.142" Width="305">
            <Grid.RenderTransform>
                <TransformGroup>
                    <ScaleTransform/>
                    <SkewTransform/>
                    <RotateTransform/>
                    <TranslateTransform/>
                </TransformGroup>
            </Grid.RenderTransform>
            <Grid Margin="10,8,0,8">
                <Border>
                    <Border.Effect>
                        <BlurEffect Radius="12" RenderingBias="Quality"/>
                    </Border.Effect>
                    <Controls:CalloutShape x:Name="MediumShadow" ArrowAlignment="Right" ArrowHeight="30" ArrowPlacement="Bottom" ArrowWidth="30" StrokeThickness="0" Margin="0,0,0,2" RenderTransformOrigin="0.507,0.861" Fill="#B0000000">
                        <Controls:CalloutShape.RenderTransform>
                            <TransformGroup>
                                <ScaleTransform/>
                                <SkewTransform AngleY="-2.5"/>
                                <RotateTransform/>
                                <TranslateTransform Y="5.5"/>
                            </TransformGroup>
                        </Controls:CalloutShape.RenderTransform>
                    </Controls:CalloutShape>
                </Border>
            </Grid>

            <Controls:CalloutShape ArrowAlignment="Right" ArrowHeight="30" ArrowPlacement="Bottom" ArrowWidth="30" StrokeThickness="0" Margin="0,0,0,11" Fill="{DynamicResource SoftDarkUIBrush}" />
            <Rectangle Fill="#073A52" StrokeThickness="0" HorizontalAlignment="Right" Width="1" Margin="0,0,0,11" Opacity="0.35"/>
            <Rectangle Fill="#073A52" StrokeThickness="0" VerticalAlignment="Bottom" Height="1" Margin="0,0,30,41" Opacity="0.45"/>

            <!-- Content Area -->
            <Grid Margin="0,3,0,29">
                <Grid.Resources>

                    <!-- CheckBox -->

                    <Style TargetType="CheckBox">
                        <Setter Property="SnapsToDevicePixels" Value="true"/>
                        <Setter Property="OverridesDefaultStyle" Value="true"/>
                        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
                        <Setter Property="Foreground" Value="white"/>
                        <Setter Property="FontSize" Value="12"/>
                        <Setter Property="Cursor" Value="Hand"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type CheckBox}">
                                    <Border Background="Transparent" Margin="0,4">
                                        <BulletDecorator>
                                            <BulletDecorator.Bullet>
                                                <Grid Width="16" Height="16">
                                                    <Border x:Name="Border" Background="Transparent" BorderBrush="{TemplateBinding Foreground}" BorderThickness="2" />
                                                    <Path x:Name="Checkmark" Width="15" Margin="2,-4,-2,4" Data="M0,0.6 L0.4,1 L1,0" Opacity="0" Stretch="Fill" Stroke="{TemplateBinding Foreground}" StrokeThickness="2.5"/>
                                                </Grid>
                                            </BulletDecorator.Bullet>
                                            <ContentPresenter Margin="8,0,0,0" />
                                        </BulletDecorator>
                                    </Border>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsChecked" Value="True">
                                            <Trigger.EnterActions>
                                                <BeginStoryboard>
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="00:00:00.2" Storyboard.TargetName="Checkmark" Storyboard.TargetProperty="Opacity" To="1"/>
                                                    </Storyboard>
                                                </BeginStoryboard>
                                            </Trigger.EnterActions>
                                            <Trigger.ExitActions>
                                                <BeginStoryboard>
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="00:00:00.2" Storyboard.TargetName="Checkmark" Storyboard.TargetProperty="Opacity"/>
                                                    </Storyboard>
                                                </BeginStoryboard>
                                            </Trigger.ExitActions>
                                        </Trigger>
                                        <Trigger Property="IsPressed" Value="true">
                                        </Trigger>
                                        <Trigger Property="IsEnabled" Value="false">
                                            <Setter TargetName="Border" Property="Background" Value="#EEEEEE"/>
                                            <Setter TargetName="Border" Property="BorderBrush" Value="#AAAAAA"/>
                                            <Setter Property="Foreground" Value="#888888"/>
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>

                    <!-- Separator -->
                    <Style TargetType="Separator">
                        <Setter Property="Margin" Value="0" />
                        <Setter Property="SnapsToDevicePixels" Value="True" />
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="Separator">
                                    <StackPanel>
                                        <Rectangle Height="1" Fill="#80000000" />
                                        <Rectangle Height="1" Fill="#28FFFFFF" />
                                    </StackPanel>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>

                    <!-- HeaderedContentControl -->
                    <Style TargetType="HeaderedContentControl">
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="HeaderedContentControl">
                                    <StackPanel>
                                        <ContentPresenter TextElement.FontSize="10" TextElement.Foreground="White" Content="{TemplateBinding Header}" Margin="0,0,0,10" />
                                        <ContentPresenter />
                                    </StackPanel>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>

                    <!-- Button -->

                    <Style TargetType="Button">
                        <Setter Property="SnapsToDevicePixels" Value="true"/>
                        <Setter Property="Foreground" Value="#404040" />
                        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
                        <Setter Property="Cursor" Value="Hand" />
                        <Setter Property="FontSize" Value="14" />
                        <Setter Property="FontWeight" Value="Bold" />
                        <Setter Property="OverridesDefaultStyle" Value="true"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="Button">
                                    <Border Background="#FFFFFF">
                                        <ContentPresenter x:Name="cp" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,-1,0,1" />
                                    </Border>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter TargetName="cp" Property="RenderTransform">
                                                <Setter.Value>
                                                    <TranslateTransform Y="-1" />
                                                </Setter.Value>
                                            </Setter>
                                        </Trigger>
                                        <Trigger Property="IsPressed" Value="True">
                                            <Setter TargetName="cp" Property="RenderTransform">
                                                <Setter.Value>
                                                    <TranslateTransform Y="0" />
                                                </Setter.Value>
                                            </Setter>
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>

                </Grid.Resources>
                <StackPanel>
                    <TextBlock FontSize="14" FontWeight="Bold" Foreground="White" Text="Регистрация пользователя" Margin="16,10" TextOptions.TextFormattingMode="Display" />

                    <Separator />

                    <!-- Text Size -->

                    <HeaderedContentControl Header="Аватар" Margin="18,10,18,20" TextOptions.TextFormattingMode="Display">
                    	<Image Height="100" Cursor="Hand" AllowDrop="True" Name="imgAvatar" Source="/HeritageAcademy.Library;component/Images/anonim.png" />
                    </HeaderedContentControl>

                    <!-- Color Scheme -->

                    <Separator />

                    <!-- Line Spacing -->

                    <HeaderedContentControl Header="Персональные данные" Margin="14,10,14,30" TextOptions.TextFormattingMode="Display">
                    	<Grid Height="173.922" Margin="10,0,0,0">
                    		<Grid x:Name="grdLogin" Height="28.987" VerticalAlignment="Top">
                    			<Grid.ColumnDefinitions>
                    				<ColumnDefinition Width="0.384*"/>
                    				<ColumnDefinition Width="0.616*"/>
                    			</Grid.ColumnDefinitions>
                    			<Label HorizontalAlignment="Right" Margin="0,0,3,0" Content="Имя в системе" FontSize="10.667" Padding="0,5,5,5" Foreground="#FFF15800" TextOptions.TextFormattingMode="Display" TextOptions.TextHintingMode="Fixed"/>
                    			<TextBox x:Name="tbLogin" TextWrapping="Wrap" Margin="0,3.513" Grid.Column="1" Height="21.96" ToolTip="Введите Ваше имя, которое Вы будете использовать для инициализации себя в системе"/>
                    		</Grid>
                    		<Grid x:Name="grdFirstName" Height="28.987" Margin="0,28.987,0,0" VerticalAlignment="Top">
                    			<Grid.ColumnDefinitions>
                    				<ColumnDefinition Width="0.374*"/>
                    				<ColumnDefinition Width="0.616*"/>
                    			</Grid.ColumnDefinitions>
                    			<Label HorizontalAlignment="Right" Margin="0,0,3,0" Content="Имя" FontSize="10.667" Padding="0,5,5,5" Foreground="#FFF15800" TextOptions.TextFormattingMode="Display" SnapsToDevicePixels="True" TextOptions.TextHintingMode="Fixed"/>
                    			<TextBox x:Name="tbName" TextWrapping="Wrap" Margin="0,3.513" Grid.Column="1" Height="21.96" ToolTip="Введите Ваше имя"/>
                    		</Grid>
                    		<Grid x:Name="grdSecondName" Height="28.987" Margin="0,57.974,0,0" VerticalAlignment="Top">
                    			<Grid.ColumnDefinitions>
                    				<ColumnDefinition Width="0.377*"/>
                    				<ColumnDefinition Width="0.623*"/>
                    			</Grid.ColumnDefinitions>
                    			<Label HorizontalAlignment="Right" Margin="0,0,3,0" Content="Фамилия" FontSize="10.667" Padding="0,5,5,5" Foreground="#FFF15800" TextOptions.TextFormattingMode="Display" TextOptions.TextHintingMode="Fixed"/>
                    			<TextBox x:Name="tbFamilyName" TextWrapping="Wrap" Margin="0,3.513" Grid.Column="1" Height="21.96" ToolTip="Введите Вашу фамилию"/>
                    		</Grid>
                    		<Grid x:Name="grdStatus" Height="28.987" Margin="0,0,0,57.974" VerticalAlignment="Bottom">
                    			<Grid.ColumnDefinitions>
                    				<ColumnDefinition Width="0.377*"/>
                    				<ColumnDefinition Width="0.623*"/>
                    			</Grid.ColumnDefinitions>
                    			<Label HorizontalAlignment="Right" Margin="0,0,3,0" Content="Должность" FontSize="10.667" Padding="0,5,5,5" Foreground="#FFF15800" TextOptions.TextFormattingMode="Display" TextOptions.TextHintingMode="Fixed"/>
                    			<TextBox x:Name="tbRole" TextWrapping="Wrap" Margin="0,3.513" Grid.Column="1" Height="21.96" ToolTip="Введите Вашу должность или профессию"/>
                    		</Grid>
                    		<Grid x:Name="grdPassword" Height="28.987" Margin="0,0,0,28.987" VerticalAlignment="Bottom">
                    			<Grid.ColumnDefinitions>
                    				<ColumnDefinition Width="0.377*"/>
                    				<ColumnDefinition Width="0.623*"/>
                    			</Grid.ColumnDefinitions>
                    			<Label Margin="0,0,3,0" Content="Пароль" FontSize="10.667" Padding="0,5,5,5" HorizontalAlignment="Right" Foreground="#FFF15800" TextOptions.TextFormattingMode="Display" TextOptions.TextHintingMode="Fixed"/>
                    			<PasswordBox x:Name="tbPassword" Margin="0,3.513" Height="21.96" Grid.Column="1" ToolTip="Введите пароль для входа в систему"/>
                    		</Grid>
                    		<Grid x:Name="grdPasswordAgain" Height="28.987" VerticalAlignment="Bottom">
                    			<Grid.ColumnDefinitions>
                    				<ColumnDefinition Width="0.377*"/>
                    				<ColumnDefinition Width="0.623*"/>
                    			</Grid.ColumnDefinitions>
                    			<Label HorizontalAlignment="Right" Margin="0,0,3,0" Content="Пароль (повтор)" FontSize="10.667" Padding="0,5,5,5" Foreground="#FFF15800" TextOptions.TextFormattingMode="Display" TextOptions.TextHintingMode="Fixed"/>
                    			<PasswordBox x:Name="tbPasswordConfirmation" Margin="0,3.513" Grid.Column="1" Height="21.96" ToolTip="Повторите ввод пароля"/>
                    		</Grid>
                    	</Grid>
                    </HeaderedContentControl>
                    <Button Margin="14,0,0,24" Width="168" Height="24" Content="Зарегистрироваться"  HorizontalAlignment="Left" Name="btnRegister" />
                        

                </StackPanel>

            </Grid>

        </Grid>
    </Canvas>
</UserControl>
